From: Florian Müllner Date: Tue, 5 Feb 2013 03:13:44 +0000 (+0100) Subject: sessionMode: Add stylesheetName property X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4961 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=fcc32fca;p=gnome-shell.git sessionMode: Add stylesheetName property This will allow to visually differentiate modes by providing separate styling. https://bugzilla.gnome.org/show_bug.cgi?id=693219 --- diff --git a/js/ui/main.js b/js/ui/main.js index 7d7d06323..5a6ab0b69 100644 --- a/js/ui/main.js +++ b/js/ui/main.js @@ -95,6 +95,8 @@ function start() { Gio.DesktopAppInfo.set_desktop_env('GNOME'); sessionMode = new SessionMode.SessionMode(); + sessionMode.connect('updated', _loadDefaultStylesheet); + shellDBusService = new ShellDBus.GnomeShell(); shellMountOpDBusService = new ShellMountOperation.GnomeShellMountOpHandler(); @@ -117,8 +119,7 @@ function start() { global.stage.color = DEFAULT_BACKGROUND_COLOR; global.stage.no_clear_hint = true; - _defaultCssStylesheet = global.datadir + '/theme/gnome-shell.css'; - loadTheme(); + _loadDefaultStylesheet(); // Set up stage hierarchy to group all UI actors under one container. uiGroup = new Shell.GenericContainer({ name: 'uiGroup' }); @@ -379,6 +380,18 @@ function _nWorkspacesChanged() { return false; } +function _loadDefaultStylesheet() { + if (!Main.sessionMode.isPrimary) + return; + + let stylesheet = global.datadir + '/theme/' + sessionMode.stylesheetName; + if (_defaultCssStylesheet == stylesheet) + return; + + _defaultCssStylesheet = stylesheet; + loadTheme(); +} + /** * getThemeStylesheet: * diff --git a/js/ui/sessionMode.js b/js/ui/sessionMode.js index 2774ad6d5..f802dbd29 100644 --- a/js/ui/sessionMode.js +++ b/js/ui/sessionMode.js @@ -15,6 +15,7 @@ const DEFAULT_MODE = 'restrictive'; const _modes = { 'restrictive': { parentMode: null, + stylesheetName: 'gnome-shell.css', hasOverview: false, showCalendarEvents: false, allowSettings: false,